package io.renren.modules.combat.service.impl;


import io.renren.modules.combat.entity.TFightPeopleEntity;
import io.renren.modules.generator.entity.TTrainingEntity;
import io.renren.modules.user.entity.TPeopleEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.combat.dao.TFightInformationDao;
import io.renren.modules.combat.entity.TFightInformationEntity;
import io.renren.modules.combat.service.TFightInformationService;


@Service("tFightInformationService")
public class TFightInformationServiceImpl extends ServiceImpl<TFightInformationDao, TFightInformationEntity> implements TFightInformationService {

    @Autowired
    private TFightInformationDao tFightInformationDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TFightInformationEntity> page = this.page(
                new Query<TFightInformationEntity>().getPage(params),
                new QueryWrapper<TFightInformationEntity>()
        );

        return new PageUtils(page);
    }

    /**
     * 列表
     * @param
     * @return
     */
    @Override
    public PageUtils getTFightInformationEntity(Map<String, Object> params){
        IPage<TFightInformationEntity> page = new Query<TFightInformationEntity>().getPage(params);
        List<TFightInformationEntity> teople = tFightInformationDao.getTFightInformationEntity(params);
        page.setRecords(teople);
        return new PageUtils(page);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @Override
    public int delTFightInformationEntity(@Param(value="id")Integer id){
        return tFightInformationDao.delTFightInformationEntity(id);
    }
    /**
     * 新增 战斗信息
     */
    @Override
    public int addTFightInformationEntity(TFightInformationEntity queryWrapper){
        return tFightInformationDao.addTFightInformationEntity(queryWrapper);
    }
    /**
     * 新增 战斗人员  批量
     */
    @Override
    public int addTFightPeopleEntity(List<TFightPeopleEntity> list){
        return tFightInformationDao.addTFightPeopleEntity(list);
    }

    /**
     * 查看  回显 战斗信息
     */
   public TFightInformationEntity bjTFightInformationEntity(Integer id){
        return tFightInformationDao.bjTFightInformationEntity(id);
    }
    /**
     * 查看  回显 战斗人员
     */
    public List<TFightPeopleEntity> getTFightPeopleEntity(Integer id){
        return tFightInformationDao.getTFightPeopleEntity(id);
    }

    /**
     * 修改 战斗信息
     */
    public int updateTFightInformationEntity(TFightInformationEntity queryWrapper){
        return tFightInformationDao.updateTFightInformationEntity(queryWrapper);
    }
    /**
     * 修改 战斗人员 批量
     */
    public int updateTFightPeopleEntity(List<TFightPeopleEntity> list){
        return tFightInformationDao.updateTFightPeopleEntity(list);
    }
    /**
     * 区域  下拉框
     */
    public List<TFightPeopleEntity> getArrer(){
        return tFightInformationDao.getArrer();
    }

    /**
     * 战斗类型 下拉框
     */
    public List<TFightPeopleEntity> getType(){
        return tFightInformationDao.getType();
    }
    /**
     * 战斗项目 下拉框
     */
    public List<TFightPeopleEntity> getObject(TFightPeopleEntity peopleEntity){
        return tFightInformationDao.getObject(peopleEntity);
    }

    /**
     * 统计  战斗类型
     */
   public List<TFightInformationEntity> getZDLX(){
        return tFightInformationDao.getZDLX();
    }
    /**
     * 统计 战斗区域
     */
    public List<TFightInformationEntity> getZDQY(){
        return tFightInformationDao.getZDQY();
    }
    /**
     * 战斗首页
     */
    public List<TFightInformationEntity> getZdsy(TFightInformationEntity tFightInformationEntity){ return tFightInformationDao.getZdsy(tFightInformationEntity);}
    /**
     * 战斗首页 中队
     */
   public List<TFightInformationEntity> getZdsyZd(TFightInformationEntity tFightInformationEntity){
        return tFightInformationDao.getZdsyZd(tFightInformationEntity);
    }
    /**
     * 获取战斗ID
     */
   public TFightInformationEntity getTFightId(){
        return tFightInformationDao.getTFightId();
    }

    /**
     * 人员信息
     * @param map
     * @return
     */
   public PageUtils queryList(Map<String,Object> map){
       IPage<TPeopleEntity> page = new Query<TPeopleEntity>().getPage(map);
       List<TPeopleEntity> tPeopleEntities = tFightInformationDao.queryList(map);
       page.setRecords(tPeopleEntities);
       return new PageUtils(page);
    }
    /**
     * 点击修改 新增人员 走这个
     */
   public int insertTFightPeople(TFightPeopleEntity peopleEntity){
        return tFightInformationDao.insertTFightPeople(peopleEntity);
    }

    /**
     * 战斗头部 所有中队总计
     */
   public List<TFightInformationEntity> totalCombatSquadron(TFightInformationEntity tFightInformationEntity){
        return tFightInformationDao.totalCombatSquadron(tFightInformationEntity);
    }
    /**
     * 战斗头部 所有支队总计
     */
   public List<TFightInformationEntity> totalCombatDetachment(TFightInformationEntity tFightInformationEntity){
       return tFightInformationDao.totalCombatDetachment(tFightInformationEntity);
   }

    /**
     * 分布图  头部统计
     */
   public List<TFightInformationEntity> totalCombatHeadCount(TFightInformationEntity tFightInformationEntity){
        return tFightInformationDao.totalCombatHeadCount(tFightInformationEntity);
    }
}